package com.itheima.dao;

import com.itheima.pojo.Cclass;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

public interface ClassMapper {
    @Select("select * from c_class where cid=#{cid} ")
    @Results({@Result(id = true,column = "cid",property = "cid"),
            @Result(column = "classname",property = "classname"),
            @Result(column = "cid",property = "studentList",
                    many = @Many(select="com.itheima.dao.StudentMapper.selectStudentByCid"))})
    Cclass selectClassById(int cid);
}
